package com.wangyuhang.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wangyuhang.dao.userDao;
import com.wangyuhang.domain.User;
import com.wangyuhang.service.userService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class userServiceImpl implements userService {
    @Autowired
    private userDao dao;

    @Override
    public List<User> findAll() {
        QueryWrapper<User> queryWrapper = new QueryWrapper<>();
        List<User> users = dao.selectList(queryWrapper);
        System.out.println(users);
        return users;
    }
/*按id查询*/
    @Override
    public User findById(Integer id) {
        User user = dao.selectById(id);
        return user;
    }
/*增加用户*/
    @Override
    public int UserInsert(User user) {
        int i = dao.insert(user);
        return i;
    }
}
